$(function(){
     jQuery("form#formReserva").validationEngine();
 });

function checarIdade(field, rules, i, options){
	var data = field.val().split("/");
	var dataAtual = new Date();
	
	if(data != ""){
		if(data[2] > (dataAtual.getFullYear() - 18))
			return options.allrules.ano.alertText;
	}
}
	
function validarEmail(field, rules, i, options) {
	$.post("/ws/validarEmail?email=" + field.val(),
		function(data){
			if(data != "true")
				alert(data);
				return options.allrules.validarEmail.alertText;
		}
	);
}